public class Tets {
    public static void fun(Animal animal){
        animal.eat();
    }
    public static void main(String[] args) {
        Animal animal1=new Dog("旺财",2);
        Animal animal2=new Cat("miao",2);
        animal1.eat();
        animal2.eat();
        System.out.println("---------------------");
       fun(new Dog("旺财",2));
       fun(new Cat("miao",2));
    }
}
